package com.cloudkinto.service.stock;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.ProductStockRackDo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author hua
 * @since 2024-10-28
 */
public interface ProductStockRackService extends IService<ProductStockRackDo> {

    int updateStockById(Long childId, int qty);

    SingleResult addInit();

    Object add(Object req, Long userId);

    SingleResult updateInit(Long id);

    Object update(Object updateVo, Long userId);

    int delete(Long id, Long userId);

    Object detail(Long id);

    SingleResult pageInit();

    List<Object> getList(Map<String, String> map);

    PageResult getListPage(Map<String, String> map);

    /**
     * 根据sku获取n个库存信息
     *
     * @param forecastQty 预测数量
     */
    List<ProductStockRackDo> getFirstInFirstOutBySku(Long tenantId, Long whId, Long productId, Integer forecastQty, Long rackId);

    List<ProductStockRackDo> getFirstInFirstOutByBoxTypeNumber(Long tenantId, Long whId, Long companyId, String boxTypeNumber, Integer forecastBoxQty, Long rackId);
}
